<?php
/**
 * Created by PhpStorm.
 * User: papa
 * Date: 18/5/10
 * Time: 11:47
 */

namespace app\api\model;


class User extends BaseModel
{
    protected $hidden = ['openid','create_time','update_time'];

    public function getGenderAttr($value)
    {
        $status = [1=>'男',0=>'女',2=>"未知"];
        return $status[$value];
    }


    public function userLevel()
    {
        return $this->belongsTo('UserLevel','level_id','id');
    }
}